﻿using UnityEngine;
using System.Collections;

public class DrawLineWhileSelected : MonoBehaviour {
	SkinnedMeshRenderer mRenderer;
	Shader drawLine;
	Shader defaultShader;
	// Use this for initialization
	void Start () {
		mRenderer = GetComponent<SkinnedMeshRenderer> ();
		drawLine = Shader.Find("Custom/MiaoBian");
		defaultShader = Shader.Find ("Standard");
		//mRenderer.materials [1] = new Material (Resources.Load ("Materials/SpecialEffect/miaobian") as Material);
		//print (mRenderer.materials [0].SetPass(0));
	}
	void OnMouseEnter(){
		//mRenderer.materials[1].shader = Resources.Load ("Shader/MiaoBian") as Shader;
		mRenderer.materials[1].shader = drawLine;
	}
	void OnMouseExit(){
		mRenderer.materials [1].shader = defaultShader;
	}
}
